Skip to content

[Bug-Fix] Fix S3 multipart copy requiring s3:GetObjectVersion on versioned buckets#3867

Merged
kai-ion merged 1 commit into
mainfrom
Headobject
Jul 15, 2026
Merged

[Bug-Fix] Fix S3 multipart copy requiring s3:GetObjectVersion on versioned buckets#3867
kai-ion merged 1 commit into
mainfrom
Headobject

Conversation

@kai-ion

@kai-ion kai-ion commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Issue #, if available:

Description of changes:
Stop auto-pinning the HeadObject-derived versionId onto UploadPartCopy
requests in S3CrtClient::PopulateCopyObjectProperties. Rely on the ETag
conditional (x-amz-copy-source-if-match) for source consistency instead.

GetObjectAnnotation and GetObjectTagging continue to use versionId since
they don't support ETag conditionals.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

// Detect source mutation via ETag conditional without requiring s3:GetObjectVersion.
// If the user explicitly provided sourceVersionId, it is already parsed above and preserved.
if (sourceVersionId.empty() && !head.GetVersionId().empty()) {
sourceVersionId = head.GetVersionId();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should remove this entire if statement. we want to honor the versionId set in the request, however not override it by the head response if it present.

@kai-ion kai-ion force-pushed the Headobject branch 2 times, most recently from 7692607 to c3cdb2c Compare July 15, 2026 17:28
@kai-ion kai-ion enabled auto-merge July 15, 2026 17:28
@kai-ion kai-ion disabled auto-merge July 15, 2026 17:28
@kai-ion kai-ion enabled auto-merge July 15, 2026 17:29
  Stop auto-pinning the HeadObject-derived versionId onto UploadPartCopy
  requests in S3CrtClient::PopulateCopyObjectProperties. Rely on the ETag
  conditional (x-amz-copy-source-if-match) for source consistency instead.

  GetObjectAnnotation and GetObjectTagging continue to use versionId since
  they don't support ETag conditionals.
@kai-ion kai-ion added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit 870d306 Jul 15, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants